package edu.washington.math.sage;

import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import java.io.PrintStream;

public class PPSMouseListener implements MouseListener,MouseMotionListener{
	PrintStream myPrintStream;
	public PPSMouseListener(){
	 myPrintStream=System.out;
	}
	 public void mouseDragged(MouseEvent theMouseEvent) {
		 //myPrintStream.println(theMouseEvent);
		 myPrintStream.println("MOUSE_DRAGGED "+theMouseEvent.getX()+" "+theMouseEvent.getY());
	 }
	public void mouseClicked(MouseEvent theMouseEvent) {
		 //myPrintStream.println(theMouseEvent);
		 myPrintStream.println("MOUSE_CLICKED "+theMouseEvent.getX()+" "+theMouseEvent.getY()+" "+theMouseEvent.getButton()+" "+theMouseEvent.getClickCount());
		 }
	public void mouseMoved(MouseEvent theMouseEvent) {
		 //myPrintStream.println(theMouseEvent);
		 myPrintStream.println("MOUSE_MOVED "+theMouseEvent.getX()+" "+theMouseEvent.getY());
	}
	public void mouseEntered(MouseEvent theMouseEvent) {
		 //myPrintStream.println(theMouseEvent);
		 myPrintStream.println("MOUSE_ENTERED "+theMouseEvent.getX()+" "+theMouseEvent.getY());
	}
	public void mouseExited(MouseEvent theMouseEvent) {
		 //myPrintStream.println(theMouseEvent);
		 myPrintStream.println("MOUSE_EXITED "+theMouseEvent.getX()+" "+theMouseEvent.getY());
	}
	public void mouseReleased(MouseEvent theMouseEvent) {
		 //myPrintStream.println(theMouseEvent);
		 myPrintStream.println("MOUSE_RELEASED "+theMouseEvent.getX()+" "+theMouseEvent.getY()+ " "+ theMouseEvent.getButton());
	 }
	public void mousePressed(MouseEvent theMouseEvent) {
		 //myPrintStream.println(theMouseEvent);
		 myPrintStream.println("MOUSE_PRESSED "+theMouseEvent.getX()+" "+theMouseEvent.getY()+" "+theMouseEvent.getButton());
	 }
}
